#ifndef _chipDefs_h
#define _chipDefs_h

#define LPC1227
#include <LPC122x.h>

/// <summary>
/// Generic type definition
/// </summary>
typedef unsigned char       u1;
typedef unsigned short      u2;
typedef unsigned int        u4;
typedef char                s1;
typedef short               s2;
typedef int                 s4;

#define ASSERT_DEBUG(X)				if (!(X)) RESET()
#define ASSERT_RELEASE(X)
#define ASSERT(X)					ASSERT_DEBUG(X)

#include <setjmp.h>
#define jmp_buf_ext         jmp_buf
#define setjmp_ext          setjmp
#define longjmp_ext         longjmp

#define RESET()  __DSB();\
	             SCB->AIRCR  = ((0x5FA << SCB_AIRCR_VECTKEY_Pos) | SCB_AIRCR_SYSRESETREQ_Msk);\
	             while(TRUE);

#endif // _chipDefs_h
